home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Online / Weblint / test.pl < prev    next >
Perl Script  |  1997-09-10  |  55KB  |  2,075 lines

  1. : # use perl
  2.         eval 'exec perl -S $0 "$@"'
  3.                 if $runnning_under_some_shell;
  4.  
  5. #
  6. # test.pl - regression tests for weblint
  7. #
  8. # Copyright (C) 1995,1996,1997 Neil Bowers.  All rights reserved.
  9. #
  10. # See README for additional blurb.
  11. # Bugs, comments, suggestions welcome: neilb@cre.canon.co.uk
  12. #
  13. $VERSION    = '1.012';
  14. ($PROGRAM = $0) =~ s@.*/@@;
  15. $FILENAME    = 'testfile.htm';
  16. $LOGFILE    = 'test.log';
  17. $ENV{WEBLINTRC} = '/dev/null';
  18. @TMPDIR_OPTIONS    = ('/usr/tmp', '/tmp', '/var/tmp', '/temp');
  19. @COLOR_NAMES    = ('aqua', 'black', 'blue', 'fuchsia', 'gray', 'green',
  20.                    'lime', 'maroon', 'navy',
  21.                    'olive', 'purple', 'red', 'silver', 'teal',
  22.                    'white', 'yellow');
  23.  
  24.  
  25. &WeblintTestInitialize();
  26. $state = 'start';
  27. while (<DATA>)
  28. {
  29.     chop;
  30.  
  31.     #--------------------------------------------------------------------
  32.     # A line of dashes (minus characters) signify end of test
  33.     #--------------------------------------------------------------------
  34.     if (/^\#----/)
  35.     {
  36.         push(@args, '') if @args == 0;
  37.         foreach $arg (@args)
  38.         {
  39.             if (@warns > 0)
  40.             {
  41.                 &ExpectWARN($subject, $arg, $body, @warns);
  42.             }
  43.             else
  44.             {
  45.                 &ExpectOK($subject, $arg, $body);
  46.             }
  47.         }
  48.  
  49.         $subject = undef;
  50.         $body    = '';
  51.         @args    = ();
  52.         @warns   = ();
  53.  
  54.         $state   = 'start';
  55.  
  56.         next;
  57.     }
  58.  
  59.     #--------------------------------------------------------------------
  60.     # A line starting with 3 (FOUR) hashes (#) delimits the HTML test
  61.     #--------------------------------------------------------------------
  62.     if (/^\#\#\#\#/)
  63.     {
  64.         $state = ($state eq 'start' || $state eq 'args') ? 'body' : 'end';
  65.  
  66.         next;
  67.     }
  68.  
  69.     #--------------------------------------------------------------------
  70.     # In START state, we are about to read the subject line of the test
  71.     #--------------------------------------------------------------------
  72.     if ($state eq 'start')
  73.     {
  74.         $subject = $_;
  75.         $state   = 'args';
  76.         next;
  77.     }
  78.  
  79.     if ($state eq 'args')
  80.     {
  81.         $_ = '' if /^\s*<none>\s*$/io;
  82.         push(@args, $_);
  83.         next;
  84.     }
  85.  
  86.     if ($state eq 'body')
  87.     {
  88.         $body .= "$_\n";
  89.         next;
  90.     }
  91.  
  92.     if ($state eq 'end')
  93.     {
  94.         next if /^\s*$/;
  95.         ($line, $id) = split(/:/, $_, 2);
  96.         push(@warns, $line, $id);
  97.         next;
  98.     }
  99. }
  100.  
  101. foreach $color (@COLOR_NAMES)
  102. {
  103.     &ExpectOK("BODY with BGCOLOR attribute set to \"$color\"", '',
  104.               "<HTML>\n<HEAD><TITLE>test</TITLE></HEAD>\n".
  105.               "<BODY BGCOLOR=\"$color\">this is the body</BODY>\n</HTML>");
  106. }
  107.  
  108. &WeblintTestEnd();
  109.  
  110.  
  111. #========================================================================
  112. # Function:    ExpectOK
  113. # Purpose:    Run a test, for which we expect no warnings.
  114. #========================================================================
  115. sub ExpectOK
  116. {
  117.    local($description, $flags, $html) = @_;
  118.    local(@results);
  119.  
  120.  
  121.    &NextTest($description);
  122.    &CreateFile($html) || die "Failed to create working file ($filename): $!\n";
  123.    @results = &RunWeblint($flags);
  124.    if (@results == 0)
  125.    {
  126.       &TestPasses();
  127.    }
  128.    else
  129.    {
  130.       &TestFails($html, @results);
  131.    }
  132. }
  133.  
  134.  
  135. #========================================================================
  136. # Function:    ExpectWARN
  137. # Purpose:    A test which we expect weblint to complain about.
  138. #        We pass in one or more expected errors.
  139. #========================================================================
  140. sub ExpectWARN
  141. {
  142.    local($description, $flags, $html, @expected) = @_;
  143.    local(@results, @notSeen);
  144.    local($i, $j);
  145.  
  146.  
  147.    &NextTest($description);
  148.    &CreateFile($html) || die "Failed to create working file ($filename): $!\n";
  149.    @results = &RunWeblint($flags);
  150.  
  151.    if (@results == 0)
  152.    {
  153.       &TestFails($html);
  154.       return;
  155.    }
  156.  
  157.    OUTER: for ($i=0; $i < $#expected; $i += 2)
  158.    {
  159.       INNER: for ($j = 0; $j < $#results; $j += 2)
  160.       {
  161.      if ($results[$j] == $expected[$i] &&
  162.          $results[$j+1] eq $expected[$i+1])
  163.      {
  164.         @lost = splice(@results, $j, 2);
  165.         next OUTER;
  166.      }
  167.       }
  168.       @notSeen = (@notSeen, $expected[$i], $expected[$i+1]);
  169.    }
  170.  
  171.    if (@notSeen == 0 && @results == 0)
  172.    {
  173.       &TestPasses();
  174.    }
  175.    else
  176.    {
  177.       &TestFails($html, @results);
  178.    }
  179. }
  180.  
  181.  
  182. #========================================================================
  183. # Function:    RunWeblint
  184. # Purpose:    This function runs weblint and parses the output.
  185. #        The results from weblint are passed back in an array.
  186. #========================================================================
  187. sub RunWeblint
  188. {
  189.    local($flags) = @_;
  190.    local(*OUTPUT);
  191.    local(@results);
  192.  
  193.  
  194.    open(OUTPUT, "./weblint -noglobals -t $flags $filename |") || do
  195.    {
  196.       die "Failed to create pipe from weblint: $!\n";
  197.    };
  198.    while (<OUTPUT>)
  199.    {
  200.       next if /^$/;
  201.       chop;
  202.       ($repfile, $line, $wid) = split(/:/);
  203.       push(@results, $line, $wid);
  204.    }
  205.    close OUTPUT;
  206.    $status = ($? >> 8);
  207.  
  208.    return @results;
  209. }
  210.  
  211.  
  212. #========================================================================
  213. # Function:    CreateFile
  214. # Purpose:    Create sample html file from text string.
  215. #========================================================================
  216. sub CreateFile
  217. {
  218.    local($html) = @_;
  219.    local(*FILE);
  220.  
  221.  
  222.    open(FILE, "> $filename") || return undef;
  223.    print FILE $html."\n";
  224.    close FILE;
  225.  
  226.    1;
  227. }
  228.  
  229. #========================================================================
  230. # Function:    WeblintTestInitialize()
  231. # Purpose:    Initialize global variables and open log file.
  232. #========================================================================
  233. sub WeblintTestInitialize
  234. {
  235.    $TMPDIR   = &PickTmpdir(@TMPDIR_OPTIONS);
  236.    $WORKDIR  = "$TMPDIR/webtest.$$";
  237.    mkdir($WORKDIR, 0755) || do
  238.    {
  239.       die "Failed to create working directory $WORKDIR: $!\n";
  240.    };
  241.  
  242.    $filename = $WORKDIR.'/'.$FILENAME;
  243.    $testID   = 0;
  244.    $failCount = 0;
  245.    $passCount = 0;
  246.  
  247.    $WEBLINTVERSION = &DetermineWeblintVersion() || 'could not determine';
  248.  
  249.    open(LOGFILE, "> $LOGFILE") || die "Can't write logfile $LOGFILE: $!\n";
  250.  
  251.    print LOGFILE "Weblint Testsuite:\n";
  252.    print LOGFILE "    Weblint Version:   $WEBLINTVERSION\n";
  253.    print LOGFILE "    Testsuite Version: $VERSION\n";
  254.    print LOGFILE '=' x 76, "\n";
  255.  
  256.    print STDERR "Running weblint testsuite:\n";
  257.    print STDERR "    Weblint Version:   $WEBLINTVERSION\n";
  258.    print STDERR "    Testsuite Version: $VERSION\n";
  259.    print STDERR "    Results Logfile:   $LOGFILE\n";
  260.    print STDERR "Running test cases (. for pass, ! for failure):\n";
  261. }
  262.  
  263. #========================================================================
  264. # Function:    DetermineWeblintVersion
  265. # Purpose:    Work out which version of weblint we think we're testing.
  266. #        Hi Adam!
  267. #========================================================================
  268. sub DetermineWeblintVersion
  269. {
  270.    local(*PIPE);
  271.    local($VERSION);
  272.  
  273.    open(PIPE, "./weblint -v 2>&1 |") || return undef;
  274.  
  275.    while (<PIPE>)
  276.    {
  277.       return $1 if /^(weblint\s+v.*)$/;
  278.  
  279.       /^\s*This is weblint, version\s*([0-9.]+)/ && do
  280.       {
  281.      return "weblint v$1";
  282.       };
  283.    }
  284. }
  285.  
  286. #========================================================================
  287. # Function:    WeblintTestEnd()
  288. # Purpose:    Generate summary in logfile, close logfile, then
  289. #        clean up working files and directory.
  290. #========================================================================
  291. sub WeblintTestEnd
  292. {
  293.    print LOGFILE '=' x 76, "\n";
  294.    print LOGFILE "Number of Passes:   $passCount\n";
  295.    print LOGFILE "Number of Failures: $failCount\n";
  296.    close LOGFILE;
  297.  
  298.    print STDERR "\n", '-' x 76, "\n";
  299.    if ($failCount > 0)
  300.    {
  301.       print STDERR "Failed tests:\n";
  302.       foreach $failure (@failedTests)
  303.       {
  304.      print STDERR "    $failure\n";
  305.       }
  306.       print STDERR '-' x 76, "\n";
  307.       
  308.    }
  309.    print STDERR "Number of Passes:   $passCount\n";
  310.    print STDERR "Number of Failures: $failCount\n";
  311.  
  312.    unlink $filename;
  313.    rmdir $WORKDIR;
  314. }
  315.  
  316. #========================================================================
  317. # Function:    NextTest()
  318. # Purpose:    Introduce a new test -- increment test id, write
  319. #        separator and test information to log file.
  320. #========================================================================
  321. sub NextTest
  322. {
  323.    local($description) = @_;
  324.  
  325.  
  326.    ++$testID;
  327.    print LOGFILE '-' x 76, "\n";
  328.    $testDescription = $description;
  329. }
  330.  
  331. #========================================================================
  332. # Function:    TestPasses()
  333. # Purpose:    The current test passed.  Write result to logfile, and
  334. #        increment the count of successful tests.
  335. #========================================================================
  336. sub TestPasses
  337. {
  338.    printf LOGFILE ("%3d %s%s%s", $testID, $testDescription,
  339.            ' ' x (68 - length($testDescription)), "PASS\n");
  340.    # printf STDERR "%3d: pass (%s)\n", $testID, $testDescription;
  341.    print STDERR ".";
  342.    print STDERR "\n" if $testID % 70 == 0;
  343.    ++$passCount;
  344. }
  345.  
  346. #========================================================================
  347. # Function:    TestFails()
  348. # Purpose:    The current test failed.  Write result to logfile,
  349. #        including the html which failed, and the output from weblint.
  350. #========================================================================
  351. sub TestFails
  352. {
  353.    local($html, @results) = @_;
  354.    local($string);
  355.  
  356.  
  357.    # printf STDERR "%3d: FAIL (%s)\n", $testID, $testDescription;
  358.    $string = sprintf("%3d: %s", $testID, $testDescription);
  359.    push(@failedTests, $string);
  360.    print STDERR "!";
  361.    print STDERR "\n" if $testID % 70 == 0;
  362.  
  363.    printf LOGFILE ("%3d %s%s%s", $testID, $testDescription,
  364.            ' ' x (68 - length($testDescription)), "FAIL\n");
  365.  
  366.    $html =~ s/\n/\n    /g;
  367.    print LOGFILE "\n  HTML:\n    $html\n\n";
  368.    print LOGFILE "  WEBLINT OUTPUT:\n";
  369.    while (@results > 1)
  370.    {
  371.       ($line, $wid) = splice(@results, 0, 2);
  372.       print LOGFILE "    line $line: $wid\n";
  373.    }
  374.    print LOGFILE "\n";
  375.    ++$failCount;
  376. }
  377.  
  378. #========================================================================
  379. # Function:    PickTmpdir
  380. # Purpose:    Pick a temporary working directory. If TMPDIR environment
  381. #        variable is set, then we try that first.
  382. #========================================================================
  383. sub PickTmpdir
  384. {
  385.    local(@options) = @_;
  386.    local($tmpdir);
  387.  
  388.    @options = ($ENV{'TMPDIR'}, @options) if defined $ENV{'TMPDIR'};
  389.    foreach $tmpdir (@options)
  390.    {
  391.       return $tmpdir if -d $tmpdir && -w $tmpdir;
  392.    }
  393.    die "$PROGRAM: unable to find a temporary directory.\n",
  394.        ' ' x (length($PROGRAM)+2), "tried: ",join(' ',@options),"\n";
  395. }
  396.  
  397. #============================================================================
  398. #============================================================================
  399.  
  400. __END__
  401. simple syntactically correct html
  402. ####
  403. <HTML>
  404. <HEAD><TITLE>test</TITLE></HEAD>
  405. <BODY>this is the body</BODY>
  406. </HTML>
  407. #------------------------------------------------------------------------
  408. paragraph usage
  409. ####
  410. <HTML>
  411. <HEAD><TITLE>test</TITLE></HEAD>
  412. <BODY>first paragraph<P>second paragraph</BODY>
  413. </HTML>
  414. #------------------------------------------------------------------------
  415. html which starts with DOCTYPE specifier
  416. ####
  417. <!DOCTYPE HTML PUBLIC '-//W3O//DTD WWW HTML 2.0//EN'>
  418. <HTML>
  419. <HEAD><TITLE>test</TITLE></HEAD>
  420. <BODY>this is the body</BODY>
  421. </HTML>
  422. #------------------------------------------------------------------------
  423. acceptable usage of META element
  424. ####
  425. <HTML><HEAD><TITLE>foo</TITLE>
  426. <META NAME="IndexType" CONTENT="Service"></HEAD>
  427. <BODY>this is the body</BODY></HTML>
  428. #------------------------------------------------------------------------
  429. correct use of information type and font style elements
  430. ####
  431. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  432. <EM>Emphasized Text</EM>
  433. <CITE>Cited Text</CITE>
  434. <STRONG>Strongly emphasized Text</STRONG>
  435. <CODE>Teletype Text</CODE>
  436. <SAMP>sequence of literal characters</SAMP>
  437. <KBD>Keyboarded Text</KBD>
  438. <VAR>Variable name</VAR>
  439. <DFN>Defining instance</DFN>
  440. <B>Bold text</B>
  441. <I>Italic text</I>
  442. <TT>Teletype text</TT>
  443. <U>Underlined text</U>
  444. <STRIKE>Striked through text</STRIKE>
  445. <BIG>Big text</BIG>
  446. <SMALL>Small text</SMALL>
  447. <SUB>Subscript text</SUB>
  448. <SUP>Superscript text</SUP>
  449. </BODY></HTML>
  450. #------------------------------------------------------------------------
  451. IMG element with ALT and ISMAP attributes
  452. ####
  453. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  454. <IMG SRC=foo.gif ISMAP ALT="alt text">
  455. </BODY></HTML>
  456. #------------------------------------------------------------------------
  457. newline within a tag
  458. ####
  459. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  460. <IMG SRC="foo.gif"
  461.  ALT="alt text">
  462. </BODY></HTML>
  463. #------------------------------------------------------------------------
  464. simple comment
  465. ####
  466. <!-- comment before the HTML element -->
  467. <HTML>
  468. <!-- comment between the HTML and HEAD elements -->
  469. <HEAD>
  470. <!-- comment in the HEAD element -->
  471. <TITLE>foo</TITLE></HEAD><BODY>
  472. <!-- this is a simple comment in the body -->
  473. this is the body
  474. </BODY>
  475. <!-- comment between end of BODY and end of HTML -->
  476. </HTML>
  477. <!-- comment after the end of the HTML element -->
  478. ####
  479. #------------------------------------------------------------------------
  480. comment with space before the closing >
  481. ####
  482. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  483. <!-- this is a simple comment -- >
  484. this is the body
  485. </BODY></HTML>
  486.  
  487. #------------------------------------------------------------------------
  488. whitespace around the = of an element attribute
  489. ####
  490. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  491. <IMG SRC = foo.gif ALT="alt text">
  492. </BODY></HTML>
  493. #------------------------------------------------------------------------
  494. legal unordered list
  495. ####
  496. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  497. <UL>
  498. <LI>first item
  499. <LI>second item</LI>
  500. </UL>
  501. </BODY></HTML>
  502. #------------------------------------------------------------------------
  503. legal definition list
  504. ####
  505. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  506. <DL>
  507. <DT>first tag<DD>first definition
  508. <DT>second tag<DD>second definition
  509. </DL>
  510. </BODY></HTML>
  511. #------------------------------------------------------------------------
  512. simple table
  513. ####
  514. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  515. <TABLE><TR><TH>height<TD>1.0<TR><TH>weight<TD>1.0</TABLE>
  516. </BODY></HTML>
  517. #------------------------------------------------------------------------
  518. table without TR
  519. ####
  520. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  521. <TABLE><TH>height<TD>1.0<TR><TH>weight<TD>1.0</TABLE>
  522. </BODY></HTML>
  523. ####
  524. 2:required-context
  525. 2:required-context
  526. #------------------------------------------------------------------------
  527. no HTML tags around document
  528. ####
  529. <HEAD><TITLE>title</TITLE></HEAD>
  530. <BODY>this is the body</BODY>
  531. ####
  532. 1:html-outer
  533. 1:must-follow
  534. #------------------------------------------------------------------------
  535. whitespace between opening < and tag name
  536. ####
  537. <HTML><HEAD>< TITLE>title</TITLE></HEAD>
  538. <BODY>this is the body</BODY></HTML>
  539. ####
  540. 1:leading-whitespace
  541. #------------------------------------------------------------------------
  542. no TITLE element in HEAD
  543. ####
  544. <HTML>
  545. <HEAD></HEAD>
  546. <BODY>this is the body</BODY>
  547. </HTML>
  548. ####
  549. 2:empty-container
  550. 2:require-head
  551. #------------------------------------------------------------------------
  552. unclosed TITLE in HEAD
  553. ####
  554. <HTML>
  555. <HEAD><TITLE></HEAD>
  556. <BODY>this is the body</BODY>
  557. </HTML>
  558. ####
  559. 2:unclosed-element
  560. #------------------------------------------------------------------------
  561. bad style to use "here" as anchor text
  562. ####
  563. <HTML>
  564. <HEAD><TITLE>title</TITLE></HEAD>
  565. <BODY><A HREF="foo.html">here</A></BODY>
  566. </HTML>
  567. ####
  568. 3:here-anchor
  569. #------------------------------------------------------------------------
  570. mis-matched heading tags <H1> .. </H2>
  571. ####
  572. <HTML>
  573. <HEAD><TITLE>title</TITLE></HEAD>
  574. <BODY><H1>title</H2></BODY>
  575. </HTML>
  576. ####
  577. 3:heading-mismatch
  578. #------------------------------------------------------------------------
  579. obsolete element
  580. ####
  581. <HTML>
  582. <HEAD><TITLE>title</TITLE></HEAD>
  583. <BODY><XMP>foobar()</XMP></BODY></HTML>
  584. ####
  585. 3:obsolete
  586. #------------------------------------------------------------------------
  587. illegal attribute in B element
  588. ####
  589. <HTML>
  590. <HEAD><TITLE>title</TITLE></HEAD>
  591. <BODY><B FOO>foobar</B></BODY></HTML>
  592. ####
  593. 3:unknown-attribute
  594. #------------------------------------------------------------------------
  595. empty tag: <>
  596. ####
  597. <HTML>
  598. <HEAD><TITLE>title</TITLE></HEAD>
  599. <BODY><>this is the body</BODY></HTML>
  600. ####
  601. 3:unknown-element
  602. #------------------------------------------------------------------------
  603. Netscape tags *without* Netscape extension enabled
  604. ####
  605. <HTML>
  606. <HEAD><TITLE>title</TITLE></HEAD>
  607. <BODY BGCOLOR="#ffffff">
  608. <CENTER>centered text</CENTER>
  609. <BLINK>blinking text</BLINK>
  610. <FONT SIZE="+1">larger font size text</FONT>
  611. </BODY></HTML>
  612. ####
  613. 5:extension-markup
  614. 5:extension-markup
  615. #------------------------------------------------------------------------
  616. Netscape tags *with* Netscape extension enabled
  617. -x Netscape
  618. ####
  619. <HTML>
  620. <HEAD><TITLE>title</TITLE></HEAD>
  621. <BODY BGCOLOR="#ffffff">
  622. <CENTER>centered text</CENTER>
  623. <BLINK>blinking text</BLINK>
  624. <FONT SIZE="+1">larger font size text</FONT>
  625. </BODY></HTML>
  626. ####
  627. #------------------------------------------------------------------------
  628. not allowed to nest FORM elements
  629. ####
  630. <HTML>
  631. <HEAD><TITLE>title</TITLE></HEAD>
  632. <BODY>
  633. <FORM METHOD=post ACTION="http://www.cre.canon.co.uk/foo">
  634. <FORM METHOD=post ACTION="http://www.cre.canon.co.uk/foo">
  635. This is inside the nested form
  636. </FORM>
  637. </FORM></BODY></HTML>
  638. ####
  639. 5:nested-element
  640. #------------------------------------------------------------------------
  641. CAPTION element appearing outside of TABLE or FIG
  642. ####
  643. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  644. <BODY>
  645. <TABLE><CAPTION>legal use of caption</CAPTION></TABLE>
  646. <CAPTION>this is an invalid use of caption</CAPTION>
  647. </BODY></HTML>
  648. ####
  649. 4:required-context
  650. #------------------------------------------------------------------------
  651. LI element must be used in DIR, MENU, OL, OL or UL
  652. ####
  653. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  654. <BODY>
  655. <DIR><LI>legal list item in DIR</DIR>
  656. <MENU><LI>legal list item in MENU</MENU>
  657. <OL><LI>legal list item in OL</OL>
  658. <UL><LI>legal list item in UL</UL>
  659. <LI>illegal list item
  660. </BODY></HTML>
  661. ####
  662. 7:required-context
  663. #------------------------------------------------------------------------
  664. unclosed comment
  665. ####
  666. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  667. <BODY>
  668. <!-- this is an unclosed comment >
  669. </BODY></HTML>
  670. ####
  671. 3:unclosed-comment
  672. #------------------------------------------------------------------------
  673. use of physical font markup
  674. -e physical-font
  675. ####
  676. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  677. <BODY>
  678. <B>This is bold text</B>
  679. <STRONG>This is strong text</STRONG>
  680. </BODY></HTML>
  681. ####
  682. 3:physical-font
  683. #------------------------------------------------------------------------
  684. repeated attribute
  685. ####
  686. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  687. <BODY>
  688. <IMG SRC="foo.gif" SRC="foo.gif" ALT="alt text">
  689. </BODY></HTML>
  690. ####
  691. 3:repeated-attribute
  692. #------------------------------------------------------------------------
  693. no HTML tags around document, last thing is valid comment
  694. ####
  695. <HEAD><TITLE>title</TITLE></HEAD>
  696. <BODY>this is the body</BODY>
  697. <!-- this is a valid comment -->
  698. ####
  699. 1:html-outer
  700. 1:must-follow
  701. #------------------------------------------------------------------------
  702. spurious text between HEAD and BODY elements
  703. ####
  704. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  705. Should not put any text here!
  706. <BODY>this is the body</BODY></HTML>
  707. ####
  708. 3:must-follow
  709. #------------------------------------------------------------------------
  710. empty title element
  711. ####
  712. <HTML><HEAD><TITLE></TITLE></HEAD>
  713. <BODY>this is the body</BODY></HTML>
  714. ####
  715. 1:empty-container
  716. #------------------------------------------------------------------------
  717. empty list element
  718. ####
  719. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  720. <BODY>
  721. <UL>
  722. <LI>this is the first element
  723. <LI>
  724. <LI>this is the third or second element...
  725. </UL>
  726. </BODY></HTML>
  727. ####
  728. 5:empty-container
  729. #------------------------------------------------------------------------
  730. attributes on closing tag
  731. ####
  732. <HTML><HEAD><TITLE>title</TITLE></HEAD>
  733. <BODY>
  734. <A NAME="foobar">bleh</A NAME="foobar">
  735. </BODY></HTML>
  736. ####
  737. 3:closing-attribute
  738. #------------------------------------------------------------------------
  739. use of ' as attribute value delimiter
  740. ####
  741. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  742. <IMG SRC = foo.gif ALT='alt text'>
  743. </BODY></HTML>
  744. ####
  745. 2:attribute-delimiter
  746. #------------------------------------------------------------------------
  747. IMG without HEIGHT and WIDTH attributes
  748. -e img-size
  749. ####
  750. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  751. <IMG SRC = foo.gif ALT="alt text">
  752. </BODY></HTML>
  753. ####
  754. 2:img-size
  755. #------------------------------------------------------------------------
  756. non-empty container, with comment last thing
  757. ####
  758. <HTML>
  759. <HEAD><TITLE>title</TITLE></HEAD>
  760. <BODY>
  761. <PRE>
  762. Some text ...
  763. <!-- last thing in container is a valid comment -->
  764. </PRE>
  765. </BODY></HTML>
  766. ####
  767. #------------------------------------------------------------------------
  768. use of -pedantic command-line switch
  769. -pedantic
  770. ####
  771. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  772. <IMG SRC = foo.gif ALT="alt text">
  773. <B>This is bold text -- should use the STRONG element</B>
  774. <A HREF="foobar.html">non-existent file</A>
  775. </BODY></HTML>
  776. ####
  777. 1:mailto-link
  778. 2:img-size
  779. 3:physical-font
  780. #------------------------------------------------------------------------
  781. leading whitespace in container
  782. -e container-whitespace
  783. ####
  784. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  785. <A HREF=foobar.html> hello</A>
  786. </BODY></HTML>
  787. ####
  788. 2:container-whitespace
  789. #------------------------------------------------------------------------
  790. valid Java applet
  791. -x Netscape
  792. -x Microsoft
  793. ####
  794. <HTML>
  795. <HEAD><TITLE>title</TITLE></HEAD>
  796. <BODY>
  797. <APPLET CODEBASE="http://java.sun.com/JDK-prebeta1/applets/NervousText" CODE="NervousText.class" WIDTH=400 HEIGHT=75 ALIGN=CENTER>
  798. <PARAM NAME="text" VALUE="This is the applet viewer.">
  799. <BLOCKQUOTE>
  800. If you were using a Java-enabled browser,
  801. you wouldn't see this!
  802. </BLOCKQUOTE>
  803. </APPLET>
  804. </BODY></HTML>
  805. #------------------------------------------------------------------------
  806. PARAM can only appear in an APPLET element
  807. -x Netscape
  808. -x Microsoft
  809. ####
  810. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  811. <PARAM NAME="text" VALUE="This is the applet viewer.">
  812. </BODY></HTML>
  813. ####
  814. 2:required-context
  815. #------------------------------------------------------------------------
  816. valid use of Netscape 2 markup
  817. -x Netscape
  818. ####
  819. <HTML>
  820. <HEAD><TITLE>title</TITLE></HEAD>
  821. <BODY>
  822. <BIG>this is big text</BIG>
  823. <SMALL>this is small text</SMALL>
  824. <SUB>this is subscript text</SUB>
  825. <SUP>this is superscript text</SUP>
  826. <MAP NAME="map1">
  827. <AREA SHAPE="RECT" COORDS="10,10,20,20" HREF="foo.html">
  828. <AREA SHAPE="RECT" COORDS="40,40,50,50" NOHREF>
  829. </MAP>
  830. <IMG SRC="pic.gif" ALT=map USEMAP="#map1">
  831. <FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST>
  832. <INPUT TYPE=submit VALUE="Send File">
  833. </FORM>
  834. </BODY></HTML>
  835.  
  836. #------------------------------------------------------------------------
  837. AREA can only appear in a MAP, MAP must have a NAME
  838. -x Netscape
  839. ####
  840. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  841. <AREA SHAPE="RECT" COORDS="10,10,20,20" HREF="foo.html">
  842. <MAP>
  843. <AREA SHAPE="RECT" COORDS="40,40,50,50" NOHREF>
  844. </MAP>
  845. </BODY></HTML>
  846. ####
  847. 2:required-context
  848. 3:required-attribute
  849. #------------------------------------------------------------------------
  850. non-empty list element, with comment last thing
  851. ####
  852. <HTML>
  853. <HEAD><TITLE>title</TITLE></HEAD>
  854. <BODY>
  855. <UL>
  856. <LI>line 9
  857. <!-- line 10 -->
  858. <LI>line 11
  859. </UL>
  860. </BODY></HTML>
  861. ####
  862. #------------------------------------------------------------------------
  863. html which doesn't start with DOCTYPE
  864. -e require-doctype
  865. ####
  866. <HTML>
  867. <HEAD><TITLE>test</TITLE></HEAD>
  868. <BODY>this is the body</BODY>
  869. </HTML>
  870. ####
  871. 1:require-doctype
  872. #------------------------------------------------------------------------
  873. html which starts with DOCTYPE
  874. -e require-doctype
  875. ####
  876. <!DOCTYPE HTML PUBLIC '-//W3O//DTD WWW HTML 2.0//EN'>
  877. <HTML>
  878. <HEAD><TITLE>test</TITLE></HEAD>
  879. <BODY>this is the body</BODY>
  880. </HTML>
  881. #------------------------------------------------------------------------
  882. should use > in place of >
  883. ####
  884. <HTML>
  885. <HEAD><TITLE>test</TITLE></HEAD>
  886. <BODY>
  887. text with > instead of >
  888. </BODY>
  889. </HTML>
  890. ####
  891. 4:literal-metacharacter
  892. #------------------------------------------------------------------------
  893. IMG element with LOWSRC attribute
  894. -x Netscape
  895. ####
  896. <HTML>
  897. <HEAD><TITLE>test</TITLE></HEAD>
  898. <BODY>
  899. <IMG SRC="foo.gif" LOWSRC="lowfoo.gif" ALT="alt text">
  900. </BODY>
  901. </HTML>
  902. #------------------------------------------------------------------------
  903. Java applet using Netscape extensions
  904. -x Netscape
  905. ####
  906. <HTML>
  907. <HEAD><TITLE>title</TITLE></HEAD>
  908. <BODY BACKGROUND="background.gif">
  909. <APPLET CODEBASE="http://java.sun.com/JDK-prebeta1/applets/NervousText" CODE="NervousText.class" WIDTH=400 HEIGHT=75 ALIGN=CENTER>
  910. <PARAM NAME="text" VALUE="This is the applet viewer.">
  911. <BLOCKQUOTE>
  912. If you were using a Java-enabled browser,
  913. you wouldn't see this!
  914. </BLOCKQUOTE>
  915. </APPLET>
  916. </BODY></HTML>
  917. #------------------------------------------------------------------------
  918. text appearing in unexpected context
  919. ####
  920. <HTML>
  921. <HEAD>
  922. Having text here is not legal!
  923. <TITLE>test</TITLE></HEAD>
  924. <BODY>
  925. <UL>
  926. Having text here is not legal!
  927. </UL>
  928. <OL>
  929. Having text here is not legal!
  930. </OL>
  931. <DL>
  932. Having text here is not legal!
  933. </DL>
  934. <TABLE>
  935. Having text here is not legal!
  936. <TR>
  937. Having text here is not legal!
  938. <TD>This is ok</TD>
  939. </TR>
  940. </TABLE>
  941. </BODY></HTML>
  942. ####
  943. 4:bad-text-context
  944. 8:bad-text-context
  945. 11:bad-text-context
  946. 14:bad-text-context
  947. 17:bad-text-context
  948. 19:bad-text-context
  949. #------------------------------------------------------------------------
  950. IMG element with illegal value for ALIGN attribute
  951. ####
  952. <HTML><HEAD><TITLE>foo</TITLE></HEAD><BODY>
  953. <IMG SRC=foo.gif ALIGN=MODDLE ALT="alt text=">
  954. </BODY></HTML>
  955. ####
  956. 2:attribute-format
  957. #------------------------------------------------------------------------
  958. new Netscape markup
  959. -x Netscape
  960. ####
  961. <HTML>
  962. <HEAD><TITLE>test</TITLE></HEAD>
  963. <BODY>
  964. To <A HREF="foo.html" TARGET="myWindow">open a window</A>
  965. <FONT COLOR="#00ff00">blue text</FONT>
  966. <FORM ACTION="foo.html" METHOD=POST>
  967. <TEXTAREA NAME=foo ROWS=24 COLS=24 WRAP=PHYSICAL>
  968. hello</TEXTAREA>
  969. </FORM>
  970. </BODY>
  971. </HTML>
  972. #------------------------------------------------------------------------
  973. valid FRAMESET example with FRAMES
  974. -x Netscape
  975. ####
  976. <HTML>
  977. <HEAD><TITLE>test</TITLE></HEAD>
  978. <FRAMESET>
  979. <FRAME SRC="cell.html">
  980. <FRAME SRC="cell.html">
  981. </FRAMESET>
  982. </HTML>
  983. #------------------------------------------------------------------------
  984. FRAME outside of FRAMESET is illegal
  985. -x Netscape
  986. ####
  987. <HTML>
  988. <HEAD><TITLE>test</TITLE></HEAD>
  989. <BODY>
  990. <FRAME SRC="cell.html">
  991. </BODY>
  992. </HTML>
  993. ####
  994. 4:required-context
  995.  
  996. #------------------------------------------------------------------------
  997. A valid JavaScript example
  998. -x Netscape
  999. ####
  1000. <HTML>
  1001. <HEAD><TITLE>test</TITLE>
  1002. <SCRIPT LANGUAGE="JavaScript">
  1003. document.write("Hello net.")
  1004. </SCRIPT>
  1005. </HEAD>
  1006. <BODY>
  1007. That's all, folks.
  1008. </BODY>
  1009. </HTML>
  1010. #------------------------------------------------------------------------
  1011. FORM element with SELECT element which has SIZE attribute
  1012. ####
  1013. <HTML>
  1014. <HEAD><TITLE>title</TITLE></HEAD>
  1015. <BODY>
  1016. <FORM METHOD=post ACTION="http://www.cre.canon.co.uk/foo">
  1017. <SELECT NAME="foobar" SIZE="50,8">
  1018. <OPTION>foobar
  1019. </SELECT>
  1020. </FORM></BODY></HTML>
  1021. #------------------------------------------------------------------------
  1022. HR element can have percentage width in Netscape
  1023. -x Netscape
  1024. ####
  1025. <HTML>
  1026. <HEAD><TITLE>title</TITLE></HEAD>
  1027. <BODY>
  1028. <HR WIDTH="50%">
  1029. </BODY></HTML>
  1030. #------------------------------------------------------------------------
  1031. Legal use of Netscape-specific table attributes
  1032. -x Netscape
  1033. ####
  1034. <HTML>
  1035. <HEAD><TITLE>title</TITLE></HEAD>
  1036. <BODY>
  1037. <TABLE BORDER=2 CELLPADDING=2 CELLSPACING=2>
  1038. <TR><TH WIDTH="10%">Hello<TD WIDTH=2>World</TR>
  1039. </TABLE>
  1040. </BODY></HTML>
  1041. ####
  1042.  
  1043. #------------------------------------------------------------------------
  1044. Ok to have empty TD elements in a table
  1045. ####
  1046. <HTML>
  1047. <HEAD><TITLE>title</TITLE></HEAD>
  1048. <BODY>
  1049. <TABLE>
  1050. <TR><TD></TD></TR>
  1051. </TABLE>
  1052. </BODY></HTML>
  1053. #------------------------------------------------------------------------
  1054. ordered lists of different TYPES
  1055. -x Netscape
  1056. ####
  1057. <HTML>
  1058. <HEAD><TITLE>title</TITLE></HEAD>
  1059. <BODY>
  1060. <OL>
  1061. <LI>Basic ordered list item
  1062. </OL>
  1063. <OL TYPE=1>
  1064. <LI>Basic ordered list item (same as default)
  1065. </OL>
  1066. <OL TYPE=a>
  1067. <LI>Basic ordered list item
  1068. </OL>
  1069. <OL TYPE=A>
  1070. <LI>Basic ordered list item
  1071. </OL>
  1072. <OL TYPE=i>
  1073. <LI>Basic ordered list item
  1074. </OL>
  1075. <OL TYPE=I>
  1076. <LI>Basic ordered list item
  1077. </OL>
  1078. </BODY></HTML>
  1079. #------------------------------------------------------------------------
  1080. valid use of Microsoft specific markup
  1081. -x Microsoft
  1082. ####
  1083. <HTML>
  1084. <HEAD><TITLE>title</TITLE>
  1085. <BGSOUND SRC="tune.wav" LOOP=5>
  1086. </HEAD>
  1087. <BODY TOPMARGIN=2 LEFTMARGIN=2>
  1088. <TABLE CELLPADDING=2 CELLSPACING=2>
  1089. <CAPTION ALIGN=CENTER VALIGN=BOTTOM>Hello</CAPTION>
  1090. <TR><TD></TD></TR>
  1091. </TABLE>
  1092. <FONT COLOR=RED FACE="Lucida" SIZE=3>Red lucida text</FONT>
  1093. <MARQUEE BGCOLOR="#FFFFBB" DIRECTION=RIGHT BEHAVIOR=SCROLL
  1094. SCROLLAMOUNT=10 SCROLLDELAY=200 WIDTH="50%" HEIGHT="50%"
  1095. ><FONT COLOR="WHITE"
  1096. >This is a scrolling marquee.</FONT></MARQUEE>
  1097. </BODY></HTML>
  1098. #------------------------------------------------------------------------
  1099. more valid use of Microsoft specific markup
  1100. -x Microsoft
  1101. ####
  1102. <HTML>
  1103. <HEAD><TITLE>title</TITLE>
  1104. </HEAD>
  1105. <BODY ALINK=red VLINK=blue LINK=green>
  1106. Hello
  1107. <MARQUEE WIDTH=200 HEIGHT=200>Hello</MARQUEE>
  1108. </BODY></HTML>
  1109. #------------------------------------------------------------------------
  1110. Use of Microsoft markup without Microsoft extension
  1111. ####
  1112. <HTML>
  1113. <HEAD><TITLE>test</TITLE></HEAD>
  1114. <BODY TOPMARGIN=2 LEFTMARGIN=2>
  1115. <FONT COLOR=RED FACE="Lucida" SIZE=3>Red lucida text</FONT>
  1116. </BODY>
  1117. </HTML>
  1118. ####
  1119. 3:extension-attribute
  1120. 3:extension-attribute
  1121. 4:extension-attribute
  1122. #------------------------------------------------------------------------
  1123. valid FRAMESET with ROWS and COLS attributes
  1124. -x Netscape
  1125. ####
  1126. <HTML>
  1127. <HEAD><TITLE>test</TITLE></HEAD>
  1128. <FRAMESET ROWS="20%,60%,20%" COLS="*,2*">
  1129. <FRAME SRC="cell.html">
  1130. <FRAME SRC="cell.html">
  1131. <FRAME SRC="cell.html">
  1132. <FRAME SRC="cell.html">
  1133. <FRAME SRC="cell.html">
  1134. <FRAME SRC="cell.html">
  1135. </FRAMESET>
  1136. </HTML>
  1137. #------------------------------------------------------------------------
  1138. BASE element with only TARGET attribute (Netscape)
  1139. -x Netscape
  1140. ####
  1141. <HTML>
  1142. <HEAD>
  1143. <BASE TARGET="banana">
  1144. <TITLE>test</TITLE>
  1145. </HEAD>
  1146. <BODY>this is the body</BODY>
  1147. </HTML>
  1148. #------------------------------------------------------------------------
  1149. use of FONT element with no attributes
  1150. -x Netscape
  1151. ####
  1152. <HTML>
  1153. <HEAD>
  1154. <TITLE>test</TITLE>
  1155. </HEAD>
  1156. <BODY>
  1157. this is the <FONT>body</FONT>
  1158. </BODY>
  1159. </HTML>
  1160. ####
  1161. 6:expected-attribute
  1162. #------------------------------------------------------------------------
  1163. Netscape table with percentage WIDTH
  1164. -x Netscape
  1165. ####
  1166. <HTML>
  1167. <HEAD>
  1168. <TITLE>test</TITLE>
  1169. </HEAD>
  1170. <BODY>
  1171. <TABLE BORDER = 5 CELLPADDING=5 CELLSPACING=5 WIDTH="100%">
  1172. <TR><TD>Hello</TD></TR>
  1173. </TABLE>
  1174. </BODY>
  1175. </HTML>
  1176. #------------------------------------------------------------------------
  1177. Netscape list with different TYPE bullets
  1178. -x Netscape
  1179. ####
  1180. <HTML>
  1181. <HEAD>
  1182. <TITLE>test</TITLE>
  1183. </HEAD>
  1184. <BODY>
  1185. <UL TYPE="disc">
  1186. <LI>First item
  1187. <LI TYPE="circle">circle bullet
  1188. <LI TYPE="square">square bullet
  1189. </UL>
  1190. </BODY>
  1191. </HTML>
  1192. #------------------------------------------------------------------------
  1193. correct and incorrect values for CLEAR attribute
  1194. ####
  1195. <HTML>
  1196. <HEAD><TITLE>test</TITLE></HEAD>
  1197. <BODY>
  1198. ok left<BR CLEAR=LEFT>
  1199. ok right<BR CLEAR=RIGHT>
  1200. ok all<BR CLEAR=ALL>
  1201. not ok<BR CLEAR=RIHGT>
  1202. </BODY>
  1203. </HTML>
  1204. ####
  1205. 7:attribute-format
  1206. #------------------------------------------------------------------------
  1207. leading whitespace in list item
  1208. -e container-whitespace
  1209. ####
  1210. <HTML>
  1211. <HEAD><TITLE>test</TITLE></HEAD>
  1212. <BODY>
  1213. <UL>
  1214. <LI>First item
  1215. <LI> Second item
  1216. <LI>Third item
  1217. </UL>
  1218. </BODY>
  1219. </HTML>
  1220. ####
  1221. 6:container-whitespace
  1222. #------------------------------------------------------------------------
  1223. illegal color attribute values
  1224. -x Netscape
  1225. ####
  1226. <HTML>
  1227. <HEAD><TITLE>test</TITLE></HEAD>
  1228. <BODY ALINK="#ffaaff" VLINK="#ggaagg">
  1229. This is the body of the page
  1230. </BODY>
  1231. </HTML>
  1232. ####
  1233. 3:attribute-format
  1234.  
  1235. #------------------------------------------------------------------------
  1236. Valid use of the Microsoft color attributes
  1237. -x Microsoft
  1238. ####
  1239. <HTML>
  1240. <HEAD>
  1241. <TITLE>test</TITLE>
  1242. </HEAD>
  1243. <BODY TEXT=black BGCOLOR=yellow LINK=Blue ALINK=red VLINK=green>
  1244. <FONT COLOR="#ff0000">red text</FONT>
  1245. <TABLE BORDER BORDERCOLOR=teal BORDERCOLORLIGHT=Fuchsia
  1246.     BORDERCOLORDARK=Gray>
  1247. <TR><TH>Bleh</TH></TR>
  1248. </TABLE>
  1249. </BODY>
  1250. </HTML>
  1251. #------------------------------------------------------------------------
  1252. use of percentages in WIDTH attribute
  1253. -x Netscape
  1254. ####
  1255. <HTML>
  1256. <HEAD>
  1257. <TITLE>test</TITLE>
  1258. </HEAD>
  1259. <BODY>
  1260. <TABLE WIDTH="100%">
  1261. <TR><TH>Bleh</TH><TD>Foobar</TD></TR>
  1262. </TABLE>
  1263. </BODY>
  1264. </HTML>
  1265. #------------------------------------------------------------------------
  1266. complicated FRAME example
  1267. -x Netscape
  1268. ####
  1269. <HTML>
  1270. <HEAD>
  1271.         <TITLE>Netscape example</TITLE>
  1272. </HEAD>
  1273. <FRAMESET COLS="50%,50%">
  1274. <NOFRAMES>
  1275. <BODY>
  1276. <H1>Title of non-frames version</H1>
  1277. This will be seen if you don't have a FRAME capable browser
  1278. </BODY>
  1279. </NOFRAMES>
  1280.  
  1281. <FRAMESET ROWS="50%,50%">
  1282.   <FRAME SRC="cell.html"><FRAME SRC="cell.html">
  1283. </FRAMESET>
  1284. <FRAMESET ROWS="33%,33%,33%">
  1285.   <FRAME SRC="cell.html"><FRAME SRC="cell.html">
  1286. <FRAME SRC="cell.html">
  1287. </FRAMESET>
  1288. </FRAMESET>
  1289. </HTML>
  1290. #------------------------------------------------------------------------
  1291. unquoted attribute value which should be quoted
  1292. -x Netscape
  1293. ####
  1294. <HTML>
  1295. <HEAD><TITLE>test</TITLE></HEAD>
  1296. <BODY TEXT=#00ffff>
  1297. <TABLE WIDTH=100%>
  1298. <TR><TH>Heading<TD>Datum</TD></TR>
  1299. </TABLE>
  1300. </BODY>
  1301. </HTML>
  1302. ####
  1303. 3:quote-attribute-value
  1304. 4:quote-attribute-value
  1305. #------------------------------------------------------------------------
  1306. use of > in a PRE element
  1307. ####
  1308. <HTML>
  1309. <HEAD><TITLE>test</TITLE></HEAD>
  1310. <BODY>
  1311. <PRE>
  1312.    if (x > y)
  1313.       printf("x is greater than y");
  1314. </PRE>
  1315. </BODY>
  1316. </HTML>
  1317. ####
  1318. 5:meta-in-pre
  1319. #------------------------------------------------------------------------
  1320. heading inside an anchor
  1321. ####
  1322. <HTML>
  1323. <HEAD><TITLE>test</TITLE></HEAD>
  1324. <BODY>
  1325. <A NAME="foo"><H2>Bogus heading in anchor</H2></A>
  1326. </BODY>
  1327. </HTML>
  1328. ####
  1329. 4:heading-in-anchor
  1330. #------------------------------------------------------------------------
  1331. TITLE of page is longer then 64 characters
  1332. ####
  1333. <HTML>
  1334. <HEAD><TITLE>WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW</TITLE></HEAD>
  1335. <BODY>
  1336. body of page
  1337. </BODY>
  1338. </HTML>
  1339. ####
  1340. 2:title-length
  1341. #------------------------------------------------------------------------
  1342. use of WRAP=HARD in TEXTAREA
  1343. -x Netscape
  1344. ####
  1345. <HTML>
  1346. <HEAD>
  1347. <TITLE>test</TITLE>
  1348. </HEAD>
  1349. <BODY>
  1350. <FORM ACTION="foo.html" METHOD=POST>
  1351. <TEXTAREA NAME=foo ROWS=24 COLS=24 WRAP=HARD>
  1352. hello</TEXTAREA>
  1353. </FORM>
  1354. </BODY>
  1355. </HTML>
  1356. #------------------------------------------------------------------------
  1357. empty list items
  1358. ####
  1359. <HTML>
  1360. <HEAD><TITLE>test</TITLE></HEAD>
  1361. <BODY>
  1362. <UL>
  1363. <LI>
  1364. <LI>Second item
  1365. <LI>
  1366. <LI>Fourth item
  1367. <LI>
  1368. </UL>
  1369. </BODY>
  1370. </HTML>
  1371. ####
  1372. 5:empty-container
  1373. 7:empty-container
  1374. 9:empty-container
  1375. #------------------------------------------------------------------------
  1376. IMG with ALT set to empty string
  1377. ####
  1378. <HTML>
  1379. <HEAD>
  1380. <TITLE>test</TITLE>
  1381. </HEAD>
  1382. <BODY>
  1383. <IMG SRC="foo.gif" ALT="">
  1384. <IMG SRC="foo.gif" ALT=''>
  1385. </BODY>
  1386. </HTML>
  1387. #------------------------------------------------------------------------
  1388. use of > multiple times in a PRE element
  1389. ####
  1390. <HTML>
  1391. <HEAD><TITLE>test</TITLE></HEAD>
  1392. <BODY>
  1393. <PRE>
  1394.    if (x > y)
  1395.       foobar();
  1396.    if (x > z)
  1397.       barfoo();
  1398. </PRE>
  1399. </BODY>
  1400. </HTML>
  1401. ####
  1402. 5:meta-in-pre
  1403. 7:meta-in-pre
  1404. #------------------------------------------------------------------------
  1405. don't check attributes of unknown elements
  1406. ####
  1407. <HTML>
  1408. <HEAD><TITLE>test</TITLE></HEAD>
  1409. <BODY>
  1410. Hello, <BOB SIZE="+1">World!</BOB>
  1411. </BODY>
  1412. </HTML>
  1413. ####
  1414. 4:unknown-element
  1415. 4:unknown-element
  1416. #------------------------------------------------------------------------
  1417. images with all variants of ALIGN for Netscape
  1418. -x Netscape
  1419. ####
  1420. <HTML>
  1421. <HEAD>
  1422. <TITLE>test</TITLE>
  1423. </HEAD>
  1424. <BODY>
  1425. <IMG SRC="foo.gif" ALT="" ALIGN=LEFT>
  1426. <IMG SRC="foo.gif" ALT="" ALIGN=RIGHT>
  1427. <IMG SRC="foo.gif" ALT="" ALIGN=TOP>
  1428. <IMG SRC="foo.gif" ALT="" ALIGN=TEXTTOP>
  1429. <IMG SRC="foo.gif" ALT="" ALIGN=MIDDLE>
  1430. <IMG SRC="foo.gif" ALT="" ALIGN=ABSMIDDLE>
  1431. <IMG SRC="foo.gif" ALT="" ALIGN=BASELINE>
  1432. <IMG SRC="foo.gif" ALT="" ALIGN=BOTTOM>
  1433. <IMG SRC="foo.gif" ALT="" ALIGN=ABSBOTTOM>
  1434. </BODY>
  1435. </HTML>
  1436. #------------------------------------------------------------------------
  1437. ISINDEX with PROMPT
  1438. ####
  1439. <HTML>
  1440. <HEAD>
  1441. <ISINDEX PROMPT="Enter Surname:">
  1442. <TITLE>test</TITLE>
  1443. </HEAD>
  1444. <BODY>
  1445. Hello, World!
  1446. </BODY>
  1447. </HTML>
  1448. #------------------------------------------------------------------------
  1449. ISINDEX with HREF is illegal in HTML 3.2
  1450. ####
  1451. <HTML>
  1452. <HEAD>
  1453. <ISINDEX HREF="phone.db" PROMPT="Enter Surname:">
  1454. <TITLE>test</TITLE>
  1455. </HEAD>
  1456. <BODY>
  1457. Hello, World!
  1458. </BODY>
  1459. </HTML>
  1460. ####
  1461. 3:extension-attribute
  1462. #------------------------------------------------------------------------
  1463. Checking against new microsoft spec #1
  1464. -x Microsoft
  1465. ####
  1466. <HTML>
  1467. <HEAD>
  1468.   <TITLE>test</TITLE>
  1469.   <BASE HREF="http://www.foo.bar/" TARGET="that_window">
  1470.   <BGSOUND SRC="tune.wav" LOOP=5>
  1471.   <ISINDEX ACTION="phone.db" PROMPT="Enter Surname:">
  1472.   <LINK HREF="other-doc.html">
  1473.   <META HTTP-EQUIV=refresh CONTENT="5; URL=foo.html">
  1474.   <META NAME="ROBOTS" CONTENT="NOFOLLOW">
  1475. </HEAD>
  1476. <BODY BACKGROUND="background.gif" BGCOLOR=white
  1477.  BGPROPERTIES=FIXED LEFTMARGIN=2 LINK=red TEXT=black VLINK=blue
  1478.  TOPMARGIN=5>
  1479. <A HREF="foo.html" NAME="foobar" REL=parent REV=made
  1480.  TARGET="_top" TITLE="The Foo Page">Foo</A>
  1481. <ADDRESS>Neil Bowers, Canon Research Europe</ADDRESS>
  1482. <APPLET ALIGN=CENTER ALT="an applet"
  1483.  CODEBASE="http://foo.com/applets/" CODE="foo.app"
  1484.  HEIGHT=100 HSPACE=5 NAME="Foo Applet" VSPACE=5 WIDTH=100>
  1485. If you were using a Java enabled browser, you wouldn't see this.
  1486. </APPLET>
  1487. <MAP NAME="mappie">
  1488. <AREA COORDS="1,1,1,1" SHAPE=RECT HREF="http://www.foo.com/"
  1489.  TARGET="_top">
  1490. </MAP>
  1491. <B>bold text</B>
  1492. <BASEFONT COLOR=red ID=times SIZE=3>
  1493. <BIG>This text is a little bit bigger</BIG>
  1494. <BLOCKQUOTE>This is in a blockquote element</BLOCKQUOTE>
  1495. <BR CLEAR=LEFT><BR CLEAR=RIGHT><BR CLEAR=ALL>
  1496. <CENTER>This text will be centered</CENTER>
  1497. <CITE>This is a citation</CITE>
  1498. <CODE>foobar() if $do_foo;</CODE>
  1499. <COMMENT>This is a comment</COMMENT>
  1500. <DL><DT>coffee<DD>one of the basic food groups</DL>
  1501. <DFN>This is a definition</DFN>
  1502. <DIR><LI>dirlist item 1<LI>dirlist item 2</DIR>
  1503. <DIV ALIGN=LEFT>left justified text</DIV>
  1504. <DIV ALIGN=CENTER>center justified text</DIV>
  1505. <DIV ALIGN=RIGHT>right justified text</DIV>
  1506. <EM>emphasized text</EM>
  1507. <EMBED HEIGHT=50 NAME="embeddedObject"
  1508.  SRC="http://www.foo.com/object" WIDTH=50>
  1509. <FONT FACE="arial" COLOR=red SIZE=4>red arial text</FONT>
  1510. <FORM METHOD=post ACTION="http://www.cre.canon.co.uk/foo"
  1511.  TARGET="fooWindow">
  1512.   <INPUT NAME="imgControl" SRC="foo.gif"
  1513.    TYPE=IMAGE VALUE=5>
  1514.   <INPUT SIZE="50,1" TYPE=TEXT MAXLENGTH=100
  1515.    VALUE="hello">
  1516.   <INPUT SIZE="50,1" TYPE=CHECKBOX CHECKED>
  1517.   <SELECT MULTIPLE SIZE=100 NAME=fruit>
  1518.     <OPTION SELECTED VALUE=1>Bananas
  1519.     <OPTION          VALUE=2>Oranges
  1520.   </SELECT>
  1521.   <TEXTAREA COLS=60 NAME=textbox ROWS=5>
  1522.     default contents
  1523.   </TEXTAREA>
  1524. </FORM>
  1525. <H1>level one heading</H1>
  1526. <HR ALIGN=LEFT COLOR=blue NOSHADE SIZE=4 WIDTH="80%">
  1527. <I>this is in italics</I>
  1528. <IFRAME ALIGN=CENTER FRAMEBORDER=1 MARGINHEIGHT=2 MARGINWIDTH=2
  1529.  NAME="bob" SCROLLING=YES SRC="bob.htm">
  1530.   This is the contents of a floating frame.
  1531. </IFRAME>
  1532. <IMG ALIGN=LEFT ALT="alt text" BORDER=1
  1533.  DYNSRC="dynsrc.mpg" HEIGHT=50 HSPACE=5 ISMAP LOOP=4
  1534.  SRC="foo.gif" USEMAP VSPACE=5 WIDTH=50>
  1535. <KBD>text entered at the keyboard</KBD>
  1536. <OL><LI TYPE=A VALUE=1>First item</OL>
  1537. <LISTING>This is for listings. Ugh.</LISTING>
  1538. <MARQUEE BEHAVIOR=SCROLL BGCOLOR="#FFFFBB"
  1539.  DIRECTION=RIGHT HEIGHT=40 HSPACE=10 LOOP=INFINITE
  1540.  SCROLLAMOUNT=10 SCROLLDELAY=200 VSPACE=10 WIDTH=500>
  1541.   This is a scrolling marquee.
  1542. </MARQUEE>
  1543. <MENU><LI>first item in menu<LI>second menu item</MENU>
  1544. <NOBR>a long line of text which i don't want to be broken</NOBR>
  1545. <OBJECT ALIGN=CENTER CLASSID="CLSID:foo"
  1546.  CODEBASE="foo/" CODETYPE=dunno DATA="foo.data"
  1547.  HEIGHT=50 NAME=bob
  1548.  TYPE=image WIDTH=50>
  1549.   contents of object element.
  1550.   <!-- dunno about correct values for TYPE yet -->
  1551.   <PARAM NAME=home VALUE="http://www.home.com" DATAFLD=field DATASRC=bob>
  1552. </OBJECT>
  1553. <P ALIGN=CENTER>centered paragraph</P>
  1554. <PLAINTEXT>some plain text</PLAINTEXT>
  1555. <PRE>some preformatted text</PRE>
  1556. <SAMP>some sample text</SAMP>
  1557. <SCRIPT LANGUAGE=VBscript>
  1558.   Visual basic script goes here
  1559. </SCRIPT>
  1560. <SMALL>some small text</SMALL>
  1561. <SPAN STYLE="margin-left: 1.0in">blah blah</SPAN>
  1562. <STRIKE>strike-through text</STRIKE>
  1563. <STRONG>strong text</STRONG>
  1564. Subscript: oxygen is O<SUB>2</SUB>
  1565. Superscript: Unix<SUP>TM</SUP>
  1566. <TABLE ALIGN=LEFT BACKGROUND="foo.gif" BGCOLOR=white BORDER=1
  1567.  BORDERCOLOR=black BORDERCOLORLIGHT=white BORDERCOLORDARK=black
  1568.  CELLPADDING=4 CELLSPACING=4 COLS=2 WIDTH="100%" FRAME=BORDER
  1569.  RULES=ALL>
  1570. <CAPTION>This is the caption for the table</CAPTION>
  1571.  
  1572. <COLGROUP ALIGN=RIGHT>
  1573.   <COL ALIGN=LEFT>
  1574.   <COL ALIGN=RIGHT>
  1575.  
  1576.   <!-- table heading section -->
  1577.   <THEAD>
  1578.     <TR ALIGN=LEFT BGCOLOR=white
  1579.      BORDERCOLOR=black BORDERCOLORDARK=black
  1580.      BORDERCOLORLIGHT=white VALIGN=TOP>
  1581.       <TH ALIGN=CENTER BACKGROUND="header.gif" BGCOLOR=white
  1582.        BORDERCOLOR=black BORDERCOLORDARK=black
  1583.        BORDERCOLORLIGHT=white COLSPAN=1 NOWRAP ROWSPAN=1
  1584.        VALIGN=TOP>Name<TH>Description
  1585.     </TR>
  1586.   </THEAD>
  1587.  
  1588.   <!-- table body section -->
  1589.   <TBODY>
  1590.     <TR>
  1591.       <TD ALIGN=CENTER BACKGROUND="header.gif" BGCOLOR=white
  1592.        BORDERCOLOR=black BORDERCOLORDARK=black
  1593.        BORDERCOLORLIGHT=white COLSPAN=1 NOWRAP ROWSPAN=1
  1594.        VALIGN=TOP>Banana<TD>Bendy, Yellow, Tasty
  1595.     </TR>
  1596.   </TBODY>
  1597.  
  1598.   <!-- table footer section -->
  1599.   <TFOOT>
  1600.     <TR>
  1601.       <TH>Name<TH>Description
  1602.     </TR>
  1603.   </TFOOT>
  1604.  
  1605. </TABLE>
  1606.  
  1607. <TT>teletype text</TT>
  1608. <U>underlined text</U>
  1609. <UL><LI>ordered item 1<LI>unordered 2</UL>
  1610. <VAR>variable</VAR>
  1611. <NOBR>let's do an explicit<WBR>line break</NOBR>
  1612. <XMP>some example text</XMP>
  1613. </BODY>
  1614. </HTML>
  1615. #------------------------------------------------------------------------
  1616. Checking new microsoft spec #2 - FRAMESET
  1617. -x Microsoft
  1618. ####
  1619. <HTML>
  1620. <HEAD>
  1621.   <TITLE>test</TITLE>
  1622.   <BASE HREF="http://www.foo.bar/" TARGET="that_window">
  1623.   <BGSOUND SRC="tune.wav" LOOP=5>
  1624. </HEAD>
  1625. <FRAMESET COLS=2 ROWS=2 FRAMEBORDER=1 FRAMESPACING=5>
  1626.   <FRAME FRAMEBORDER=1 MARGINHEIGHT=4 MARGINWIDTH=4
  1627.    NAME="myFrame" NORESIZE SCROLLING=YES SRC="foo.html">
  1628.   <NOFRAMES>
  1629.     <BODY>
  1630.       This is what you see if you don't have a frames browser
  1631.     </BODY>
  1632.   </NOFRAMES>
  1633. </FRAMESET>
  1634. </HTML>
  1635. #------------------------------------------------------------------------
  1636. basic structure with Wilbur enabled
  1637. ####
  1638. <HTML>
  1639. <HEAD>
  1640.   <TITLE>test</TITLE>
  1641. </HEAD>
  1642. <BODY BACKGROUND="back.gif" BGCOLOR=white TEXT=black
  1643.  LINK=blue VLINK=red ALINK=purple>
  1644.     Hello, World!
  1645. </BODY>
  1646. </HTML>
  1647. #------------------------------------------------------------------------
  1648. Wilbur test #2
  1649. ####
  1650. <HTML>
  1651. <HEAD>
  1652.     <ISINDEX PROMPT="text prompt">
  1653.     <TITLE>test</TITLE>
  1654.     <LINK HREF="foo" REL="rel" REV=MADE TITLE="le title">
  1655. </HEAD>
  1656. <BODY>
  1657. <BASEFONT SIZE=4>
  1658.     <APPLET ALIGN=LEFT ALT="alt text" CODE="foo code"
  1659.      CODEBASE="applets" HEIGHT=100 HSPACE=5 NAME=applet
  1660.      VSPACE=5 WIDTH=100>
  1661.         <PARAM NAME="fruit" VALUE="banana">
  1662.     </APPLET>
  1663. <MAP NAME="testmap">
  1664.     <AREA ALT="alt test" COORDS="1,1,2,2" SHAPE=RECT
  1665.      HREF="foo.html">
  1666.     <AREA COORDS="2,2,4,4" SHAPE=CIRCLE NOHREF>
  1667. </MAP>
  1668. <BR><BR CLEAR=LEFT><BR CLEAR=RIGHT><BR CLEAR=ALL><BR CLEAR=NONE>
  1669. <DIR><LI>item 1<LI>item 2</DIR>
  1670. <DIR COMPACT><LI>item 1<LI>item 2</DIR>
  1671. <DIV>a text division</DIV>
  1672. <DIV ALIGN=LEFT>left aligned text</DIV>
  1673. <DIV ALIGN=CENTER>center aligned text</DIV>
  1674. <DIV ALIGN=RIGHT>right aligned text</DIV>
  1675. <FONT SIZE=4>size 4 text</FONT>
  1676. <FONT COLOR=red>red text</FONT>
  1677. <H1 ALIGN=LEFT>left aligned level 1 heading</H1>
  1678. <H2 ALIGN=CENTER>centered level 2 heading</H2>
  1679. <H3 ALIGN=RIGHT>right aligned level 3 heading</H3>
  1680. <H4 ALIGN=LEFT>left aligned level 4 heading</H4>
  1681. <H5 ALIGN=CENTER>centered level 5 heading</H5>
  1682. <H6 ALIGN=RIGHT>right aligned level 6 heading</H6>
  1683. <IMG ALIGN=LEFT ALT="alt text" BORDER=1
  1684.  HEIGHT=50 HSPACE=5 ISMAP
  1685.  SRC="foo.gif" USEMAP VSPACE=5 WIDTH=50>
  1686. <UL><LI TYPE=DISC>item 1<LI TYPE=SQUARE>item 2
  1687.     <LI TYPE=CIRCLE>item 3</UL>
  1688. <OL><LI TYPE=A VALUE=1>item 1<LI TYPE=a>item 2
  1689.     <LI TYPE=i>item 3<LI TYPE=I>item 4<LI TYPE=1>item 5</OL>
  1690. <MENU><LI>item 1<LI>item 2</MENU>
  1691. <MENU COMPACT><LI>compact item 1<LI>compact item 2</MENU>
  1692. <OL TYPE=a START=1 COMPACT><LI>item 1<LI>item 2</OL>
  1693. <P ALIGN=CENTER>centered paragraph</P>
  1694. <UL TYPE=disc COMPACT><LI>item 1<LI>item 2</UL>
  1695. </BODY>
  1696. </HTML>
  1697. #------------------------------------------------------------------------
  1698. BASEFONT must have SIZE attribute
  1699. <none>
  1700. -x Netscape
  1701. ####
  1702. <HTML>
  1703. <HEAD>
  1704.   <TITLE>test</TITLE>
  1705. </HEAD>
  1706. <BODY>
  1707. <BASEFONT>
  1708. </BODY>
  1709. </HTML>
  1710. ####
  1711. 6:required-attribute
  1712. #------------------------------------------------------------------------
  1713. Anchor (A) element with Netscape 4 attributes for Javascript
  1714. -x Netscape
  1715. ####
  1716. <HTML>
  1717. <HEAD>
  1718.   <TITLE>test</TITLE>
  1719. </HEAD>
  1720. <BODY>
  1721. <A HREF=foo NAME=name ONCLICK="click()" ONMOUSEOUT="out()"
  1722.    ONMOUSEOVER="over()" TARGET="_top">fun stuff</A>
  1723. </BODY>
  1724. </HTML>
  1725. #------------------------------------------------------------------------
  1726. Legal use of ADDRESS element
  1727. <none>
  1728. -x Netscape
  1729. -x Microsoft
  1730. ####
  1731. <HTML>
  1732. <HEAD>
  1733.   <TITLE>test</TITLE>
  1734. </HEAD>
  1735. <BODY>
  1736. Hello, World!
  1737. <ADDRESS>Neil Bowers</ADDRESS>
  1738. </BODY>
  1739. </HTML>
  1740. #------------------------------------------------------------------------
  1741. Netscape use of APPLET element
  1742. -x Netscape
  1743. ####
  1744. <HTML><HEAD><TITLE>test</TITLE></HEAD>
  1745. <BODY>
  1746. <APPLET ALIGN=CENTER
  1747.         ALT="alternate text"
  1748.         CODEBASE="StarField/"
  1749.         CODE="stars.class"
  1750.         WIDTH=400
  1751.         HEIGHT=100
  1752.         VSPACE=5
  1753.         HSPACE=5
  1754.         MAYSCRIPT
  1755.         NAME=Bob
  1756. >
  1757.  
  1758. <PARAM NAME="numstars" VALUE="50">
  1759. </APPLET>
  1760.  
  1761. <APPLET ARCHIVE="archive.jar"
  1762.         CODE="stars.class">
  1763. <PARAM NAME="numstars" VALUE="50">
  1764. </APPLET>
  1765.  
  1766. </BODY>
  1767. </HTML>
  1768. #------------------------------------------------------------------------
  1769. Netscape client-side image map with JavaScript attributes
  1770. -x Netscape
  1771. ####
  1772. <HTML><HEAD><TITLE>test</TITLE></HEAD><BODY>
  1773. <MAP NAME="mainmap">
  1774.           <AREA COORDS="0,0,65,24" HREF="/escapes/index.html">
  1775.           <AREA SHAPE=circle COORDS="50,50,65,65" HREF="foo/" NAME=Bob>
  1776.           <AREA SHAPE=rect COORDS="20,20,65,65" NOHREF TARGET="_top">
  1777.           <AREA SHAPE=poly COORDS="20,20,65,65,30,65" HREF="bar/"
  1778.                 ONMOUSEOVER="over()" ONMOUSEOUT="out()">
  1779. </MAP>
  1780. </BODY></HTML>
  1781. #------------------------------------------------------------------------
  1782. The text style elements supported by Netscape 4
  1783. -x Netscape
  1784. ####
  1785. <HTML><HEAD><TITLE>test</TITLE></HEAD><BODY>
  1786.     <B>      bold text        </B>
  1787.     <BIG>    big text         </BIG>
  1788.     <BLINK>  blinking text    </BLINK>
  1789.     <I>      italic text      </I>
  1790.     <KBD>    keyboard text    </KBD>
  1791.     <CITE>   citation         </CITE>
  1792.     <CODE>   code goes here   </CODE>
  1793.     <EM>     emphasised text  </EM>
  1794.     <S>      strikeout type   </S>
  1795.     <SAMP>   sample text      </SAMP>
  1796.     <SMALL>  small text       </SMALL>
  1797.     <STRIKE> strikeout text   </STRIKE>
  1798.     <STRONG> strong emphasis  </STRONG>
  1799.     <SUB>    subscript text   </SUB>
  1800.     <SUP>    superscript text </SUP>
  1801.     <TT>     typewriter font  </TT>
  1802.     <U>      underlined text  </U>
  1803.     <BLOCKQUOTE>blockquoted text</BLOCKQUOTE>
  1804.     <FONT FACE=Helvetica SIZE=4 COLOR=red>red helvetica text</FONT>
  1805. </BODY></HTML>
  1806. #------------------------------------------------------------------------
  1807. Use of BASE element with just the HREF attribute
  1808. <none>
  1809. -x Netscape
  1810. -x Microsoft
  1811. ####
  1812. <HTML>
  1813. <HEAD>
  1814.     <TITLE>test</TITLE>
  1815.     <BASE HREF="http://www.cre.canon.co.uk/~neilb/">
  1816. </HEAD><BODY>
  1817. <A HREF="weblint/">Weblint home page</A>
  1818. </BODY></HTML>
  1819. #------------------------------------------------------------------------
  1820. BODY element with all Netscape attributes
  1821. -x Netscape
  1822. ####
  1823. <HTML>
  1824. <HEAD>
  1825.     <TITLE>test</TITLE>
  1826. </HEAD>
  1827. <BODY ALINK=red BACKGROUND="background.gif" BGCOLOR=white LINK=blue
  1828.       TEXT=BLACK ONBLUR="blur()" ONFOCUS="focus()" ONLOAD="load()"
  1829.       ONUNLOAD="unload()" VLINK="purple">
  1830. Hello, World!
  1831. </BODY></HTML>
  1832. #------------------------------------------------------------------------
  1833. EMBED element with Netscape enabled
  1834. -x Netscape
  1835. ####
  1836. <HTML><HEAD><TITLE>embed test</TITLE></HEAD>
  1837. <BODY>
  1838. <NOEMBED>
  1839. This page requires a web browser which supports the EMBED element.
  1840. </NOEMBED>
  1841. <EMBED ALIGN=CENTER BORDER=1 FRAMEBORDER=NO HEIGHT=250 WIDTH=150
  1842.        SRC="MyMovie.mov" CONTROLS=TRUE
  1843.        HSPACE=5 VSPACE=5 PALETTE=FOREGROUND PLUGINSPAGE="plugins/"
  1844.        TYPE="image/gif" HIDDEN=FALSE
  1845.        >
  1846. </BODY></HTML>
  1847. #------------------------------------------------------------------------
  1848. FORM with Netscape JavaScript extensions
  1849. -x Netscape
  1850. ####
  1851. <HTML><HEAD><TITLE>embed test</TITLE></HEAD>
  1852. <BODY>
  1853. <FORM ACTION="foo.pl" ENCTYPE="encoding" METHOD=GET NAME=Bob
  1854.       ONRESET="reset()" ONSUBMIT="submit()" TARGET="_top">
  1855. <INPUT TYPE=BUTTON NAME=button ONCLICK="click()">
  1856. <INPUT TYPE=CHECKBOX NAME=box CHECKED ONCLICK="click()" VALUE="bob">
  1857. <INPUT TYPE=FILE NAME=file VALUE="foo">
  1858. <INPUT TYPE="hidden" NAME="password" VALUE="weblint">
  1859. <INPUT TYPE=IMAGE ALIGN=LEFT NAME=image SRC="foo.gif">
  1860. <INPUT TYPE=PASSWORD MAXLENGTH=16 NAME=password ONSELECT="select()"
  1861.        SIZE=24 VALUE="bob">
  1862. <INPUT TYPE=RADIO NAME=radio ONCLICK="click()" VALUE="bob" CHECKED>
  1863. <INPUT TYPE=RESET NAME=reset ONCLICK="reset()" VALUE="Reset">
  1864. <INPUT TYPE=SUBMIT NAME=submit VALUE=" Submit ">
  1865. <INPUT TYPE=TEXT MAXLENGTH=64 NAME=title ONBLUR="blur()" ONCHANGE="change()"
  1866.        ONFOCUS="focus()" ONSELECT="select()" SIZE=24 VALUE="">
  1867. <KEYGEN NAME=halt CHALLENGE="who goes there?">
  1868. <SELECT NAME=Name MULTIPLE ONBLUR="blur()" ONCHANGE="change()"
  1869.         ONCLICK="click()" ONFOCUS="focus()" SIZE=2>
  1870.     <OPTION VALUE="Bob" SELECTED>Bob
  1871.     <OPTION VALUE="Fred">Fred
  1872. </SELECT>
  1873. <TEXTAREA COLS=50 NAME=textarea ONBLUR="blur()" ONCHANGE="change()"
  1874.           ONFOCUS="focus()" ONSELECT="select()" ROWS=4 WRAP=HARD>
  1875.     context of text area
  1876. </TEXTAREA>
  1877. </FORM>
  1878. </BODY></HTML>
  1879. #------------------------------------------------------------------------
  1880. H1 through H6 with combinations of ALIGN attribute
  1881. <none>
  1882. -x Netscape
  1883. -x Microsoft
  1884. ####
  1885. <HTML><HEAD><TITLE>embed test</TITLE></HEAD>
  1886. <BODY>
  1887. <H1>Level 1 heading</H1>
  1888. <H2 ALIGN=LEFT>level 2 heading</H2>
  1889. <H3 ALIGN=CENTER>level 3</H3>
  1890. <H4 ALIGN=CENTER>level 4</H4>
  1891. <H5 ALIGN=CENTER>level 5</H5>
  1892. <H6 ALIGN=CENTER>level 6</H6>
  1893. </BODY></HTML>
  1894. #------------------------------------------------------------------------
  1895. HR with all attributes set
  1896. <none>
  1897. -x Netscape
  1898. -x Microsoft
  1899. ####
  1900. <HTML><HEAD><TITLE>embed test</TITLE></HEAD>
  1901. <BODY>
  1902. Hello
  1903. <HR NOSHADE WIDTH="50%" SIZE=3 ALIGN=CENTER>
  1904. World
  1905. </BODY></HTML>
  1906. #------------------------------------------------------------------------
  1907. Netscape LAYERs
  1908. -x Netscape
  1909. ####
  1910. <HTML><HEAD><TITLE>embed test</TITLE></HEAD>
  1911. <BODY>
  1912.     <LAYER ID=layer1 TOP=50 LEFT=100>
  1913.         <H1>Layer 1 heading</H1>
  1914.         <P>Lots of content for this layer</P>
  1915.         </LAYER>
  1916.  
  1917.     <LAYER ID=layer2 TOP=100 LEFT=200>
  1918.         <P>Content for layer 2</P>
  1919.     </LAYER>
  1920.  
  1921.     <LAYER ID=layer3 TOP=200 LEFT=260>
  1922.         <H1>This heading is all there is in layer3</H1>
  1923.     </LAYER>
  1924.  
  1925.     <NOLAYER>
  1926.         This page is written for a browser which supports
  1927.         the LAYER element, such as Netscape.
  1928.     </NOLAYER>
  1929. </BODY></HTML>
  1930. #------------------------------------------------------------------------
  1931. Netscape example using LINK to link to an external stylesheet
  1932. -x Netscape
  1933. ####
  1934. <HTML>
  1935. <HEAD>
  1936.  
  1937.     <TITLE>A Good Title</TITLE>
  1938.  
  1939.             <LINK REL=STYLESHEET TYPE="text/JavaScript"
  1940.  
  1941.                 HREF="http://style.com/mystyles1" TITLE="Cool">
  1942.  
  1943.     </HEAD>
  1944. <BODY>
  1945. Hello, World!
  1946. </BODY></HTML>
  1947. #------------------------------------------------------------------------
  1948. Netscape MULTICOL example
  1949. -x Netscape
  1950. ####
  1951. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  1952. <BODY>
  1953. <MULTICOL COLS=2 GUTTER=5 WIDTH="500">
  1954. Blah blah blah.
  1955. </MULTICOL>
  1956. </BODY></HTML>
  1957. #------------------------------------------------------------------------
  1958. Use of the NOBR element with an explicit word break
  1959. -x Netscape
  1960. -x Microsoft
  1961. ####
  1962. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  1963. <BODY>
  1964. <NOBR>This is a very long ling<WBR>which we don't want broken up.</NOBR>
  1965. </BODY></HTML>
  1966. #------------------------------------------------------------------------
  1967. Use of the SERVER tag with Netscape's livewire
  1968. -x Netscape
  1969. ####
  1970. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  1971. <BODY>
  1972. <SERVER>
  1973.  
  1974.    database.connect("INFORMIX", "blue", "ADMIN", "MANAGER", "mydb")
  1975.  
  1976. </SERVER>
  1977. </BODY></HTML>
  1978. #------------------------------------------------------------------------
  1979. Use of the SPACER element
  1980. -x Netscape
  1981. ####
  1982. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  1983. <BODY>
  1984. Hello
  1985. <SPACER ALIGN=CENTER HEIGHT=100 SIZE=100 TYPE=VERTICAL WIDTH=100>
  1986. World
  1987. </BODY></HTML>
  1988. #------------------------------------------------------------------------
  1989. Use of STYLE and SPAN with Netscape
  1990. -x Netscape
  1991. ####
  1992. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  1993. <BODY>
  1994.     <STYLE TYPE="text/javascript">
  1995.  
  1996.             classes.initDropCap.fontSize="12pt";
  1997.  
  1998.             classes.initDropCap.lineHeight = "12pt";
  1999.  
  2000.             classes.initDropCap.fontSize *= 2; // 200%
  2001.  
  2002.             classes.initDropCap.align = "left";
  2003.  
  2004.     </STYLE>
  2005.  
  2006.     <P><SPAN class="initDropCap">T</SPAN>his is ...</P>
  2007. </BODY></HTML>
  2008. #------------------------------------------------------------------------
  2009. Netscape TABLE example
  2010. -x Netscape
  2011. ####
  2012. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  2013. <BODY>
  2014. <TABLE ALIGN=LEFT BGCOLOR=white BORDER=1 CELLPADDING=5 CELLSPACING=5
  2015.        HEIGHT=20 HSPACE=5 WIDTH="100%" VSPACE=5 COLS=2>
  2016. <CAPTION ALIGN=CENTER>This is the caption</CAPTION>
  2017. <TR ALIGN=CENTER BGCOLOR=white VALIGN=MIDDLE>
  2018.     <TH ALIGN=RIGHT BGCOLOR=black COLSPAN=1 NOWRAP ROWSPAN=2 VALIGN=BOTTOM>
  2019.         Hello</TH>
  2020.     <TD ALIGN=LEFT BGCOLOR=red COLSPAN=1 NOWRAP>
  2021.         World</TD>
  2022. </TR>
  2023. </TABLE>
  2024. </BODY></HTML>
  2025. #------------------------------------------------------------------------
  2026. Microsoft Anchor (A) usage
  2027. -x Microsoft
  2028. ####
  2029. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  2030. <BODY>
  2031. <A ACCESSKEY="a" CLASS=thing DATAFLD=field DATASRC=foo HREF="foobar"
  2032.    ID=Bob LANG=ja LANGUAGE=JAVASCRIPT METHODS=method NAME=bob
  2033.    REL="stylesheet" REV="stylesheet" STYLE="foo" TARGET="_top"
  2034.    TITLE="title" URN="boburn" ONBLUR="blur()" ONDBLCLICK="double()"
  2035.    ONHELP="help()" ONKEYPRESS="key()" ONMOUSEDOWN="down()" ONMOUSEOUT="out()"
  2036.    ONMOUSEUP="up()" ONCLICK="foo()" ONFOCUS="foo()" ONKEYDOWN="foo()"
  2037.    ONKEYUP="foo()" ONMOUSEMOVE="move()" ONMOUSEOVER="over()"
  2038.    ONSELECTSTART="start()">foo</A>
  2039. </BODY></HTML>
  2040. #------------------------------------------------------------------------
  2041. OPTION can have an optional closing tag
  2042. <none>
  2043. -x Microsoft
  2044. -x Netscape
  2045. ####
  2046. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  2047. <BODY>
  2048. <FORM ACTION="foo.pl" METHOD=POST>
  2049. <SELECT NAME=COLOR>
  2050. <OPTION VALUE=red>Red
  2051. <OPTION VALUE=green>Green</OPTION>
  2052. <OPTION VALUE=blue>Blue</OPTION>
  2053. </SELECT>
  2054. </FORM>
  2055. </BODY></HTML>
  2056. #------------------------------------------------------------------------
  2057. Should now get a warning if you have an empty OPTION in a SELECT
  2058. <none>
  2059. -x Microsoft
  2060. -x Netscape
  2061. ####
  2062. <HTML><HEAD><TITLE>foo</TITLE></HEAD>
  2063. <BODY>
  2064. <FORM ACTION="foo.pl" METHOD=POST>
  2065. <SELECT NAME=COLOR>
  2066. <OPTION VALUE=red>
  2067. <OPTION VALUE=green>Green</OPTION>
  2068. <OPTION VALUE=blue>Blue</OPTION>
  2069. </SELECT>
  2070. </FORM>
  2071. </BODY></HTML>
  2072. ####
  2073. 5:empty-container
  2074. #------------------------------------------------------------------------
  2075.